// require tinymce

function createTitleEditor(selector, onTitleCreated) {
    tinymce.init({
        selector: selector,
        inline: true,
        toolbar: "undo redo | cut copy paste",
        menubar: false,
        font_formats: "Serif=serif",
        extended_valid_elements: "span[!class]",
        init_instance_callback: onTitleCreated,
        oninit: "setPlainText",
        plugins: ["paste"],
        paste_as_text: true
    });
}

function createContentEditor(selector, onContentCreated) {
    tinymce.init({
        selector: selector,
        inline: true,
        plugins: ["table", "paste"],
        paste_as_text: true,
        toolbar1: "cut copy paste | undo redo",
        toolbar2: "alignleft aligncenter alignright alignjustify | outdent indent",
        toolbar3: "bold italic underline | strikethrough | subscript superscript | bullist numlist",
        menubar: false,
        font_formats: "Sans Serif=sans-serif",
        extended_valid_elements: "span[!class]",
        init_instance_callback: onContentCreated
    });
}